import request from "@/utils/request";

const api_name = "/admin/hosp/hospitalSet";

export default {
  getPageList(page, limit, searchObj) {
    return request({
      url: `${api_name}/${page}/${limit}`,
      method: "get",
      params: searchObj,
    });
  },
  //删除医院设置
  deleteHospSet(id) {
    return request({
      url: `${api_name}/${id}`,
      method: "delete",
    });
  },
  // 批量删除
  removeRows(idList) {
    return request({
      url: `${api_name}/batchRemove`,
      method: "delete",
      data: idList,
    });
  },
  //添加医院设置
  saveHospSet(hospitalSet) {
    return request({
      url: `${api_name}/saveHospitalSet`,
      method: "post",
      data: hospitalSet,
    });
  },
  // 单记录回显
  getHospSet(id) {
    return request({
      url: `${api_name}/getHospSet/${id}`,
      method: "get",
    });
  },
  //修改医院设置
  updateHospSet(hospitalSet) {
    return request ({
      url: `/admin/hosp/hospitalSet/updateHospitalSet`,
      method: 'post',
      data: hospitalSet
    })
  },
  //锁定和取消锁定
  lockHospSet(id,status) {
    return request ({
      url: `/admin/hosp/hospitalSet/lockHospitalSet/${id}/${status}`,
      method: 'put'
    })
  },
};
